<template>
    <div>
      <el-dialog title="批量新增" :visible.sync="open">
        <el-form :model="form" label-width="80">
          <el-form-item label="活动名称" >
            <file-upload ref="upload" :limit="1" :fileType="['xls']" :fileSize="5" @input="handleInput"></file-upload>
          </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer">
          <el-button @click="open = false">取 消</el-button>
            <el-button type="primary" @click="submitForm">确 定</el-button>
        </div>
      </el-dialog>
    </div>
</template>

<script>
import FileUpload from "@/components/FileUpload/index.vue";
import {uploadClues} from '@/api/crm/clue';
export default {
  name: "batch-add",
  components:{FileUpload},
  data()
  {
    return{
      open:false,
      form:{
        filename:'',
      },
    }
  },
  methods:{
    handleInput(filename){
      this.form.filename=filename;
    },
    // resetForm(){
    //   this.form={
    //     filename: ''
    //   }
    // },
    submitForm(){
      uploadClues(this.form).then(() => {
        this.$modal.msgSuccess('操作成功');
        this.open = false;
        this.$emit('success')
      })
    }
  }
}
</script>

<style scoped>

</style>
